﻿using System;
using System.Windows;
using LayeredArchitectureSample.ViewModel;

namespace LayeredArchitectureSample.ClientBrowser
{
    /// <summary>
    /// Interaction logic for MainView.xaml
    /// </summary>
    public partial class MainView : Window
    {
        private readonly MainViewModel _viewModel;

        internal MainView(MainViewModel viewModel)
        {
            if (viewModel == null) throw new ArgumentNullException("viewModel");

            _viewModel = viewModel;

            InitializeComponent();
        }

        private void BrowseWaresButtonClick(object sender, RoutedEventArgs e)
        {
            _viewModel.BrowseWares();
        }

        private void ShutdownButtonClick(object sender, RoutedEventArgs e)
        {
            _viewModel.CloseDown();
        }

        private void BrowseLocationsButtonClick(object sender, RoutedEventArgs e)
        {
            _viewModel.BrowseLocations();
        }

        private void BrowseRoutesButtonClick(object sender, RoutedEventArgs e)
        {
            _viewModel.BrowseRoutes();
        }

        private void BrowseTripsButtonClick(object sender, RoutedEventArgs e)
        {
            _viewModel.BrowseTrips();
        }
    }
}